<!DOCTYPE html>
<html lang="en">

<head>
    <title>多态</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/style.css" rel="stylesheet">
</head>

<body>
    <script>
        //多态
        function add() {
            var arg = arguments,
                len = arg.length;
            switch (len) {
                case 0:
                    return 10;
                case 1:
                    return 10 + arg[0];
                case 2:
                    return arg[0] + arg[1];
            }
        }
    </script>
</body>

</html>